﻿# MySQL-Front 5.0  (Build 1.0)

/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS */;
/*!40014 SET FOREIGN_KEY_CHECKS=0 */;


# Host: localhost    Database: cake
# ------------------------------------------------------
# Server version 5.0.67-community-nt

DROP DATABASE IF EXISTS `cake`;
CREATE DATABASE `cake` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `cake`;

#
# Table structure for table cake
#

CREATE TABLE `cake` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(30) default NULL,
  `price` decimal(10,2) default NULL,
  `remark` varchar(2000) default NULL,
  `picture` varchar(200) default NULL,
  `category` bigint(20) default NULL,
  `valid` int(1) default '1',
  PRIMARY KEY  (`id`),
  KEY `FK_Reference_1` (`category`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=gbk;
INSERT INTO `cake` VALUES (1,'Mousse',29,'taste good3','images/cake/musi.jpg',1,1);
INSERT INTO `cake` VALUES (2,'Chocolate',99,'taste good','images/cake/qiaokeli.jpg',1,1);
INSERT INTO `cake` VALUES (3,'Wedding cake',25,'taste good','images/cake/hunli.jpg',1,1);
INSERT INTO `cake` VALUES (4,'Children’s cake',120,'taste good','images/cake/ertong.jpg',1,1);
INSERT INTO `cake` VALUES (5,'Baked bread',68,'taste good','images/bread/tianbao.jpg',2,1);
INSERT INTO `cake` VALUES (6,'Sandwich bread',99,'taste good','images/bread/jiaxian.jpg',2,1);
INSERT INTO `cake` VALUES (7,'Denmark bread',20,'taste good','images/bread/danmai.jpg',2,1);
INSERT INTO `cake` VALUES (8,'French long loaf bread',120,'taste good','images/bread/fabang.jpg',2,1);
INSERT INTO `cake` VALUES (9,'Pudding',58,'taste good','images/xidian/changwen.jpg',3,1);
INSERT INTO `cake` VALUES (10,'Pie',99,'taste good','images/xidian/pai.jpg',3,1);
INSERT INTO `cake` VALUES (11,'Rusks',20,'taste good','images/bingan/jianguo.jpg',4,1);
INSERT INTO `cake` VALUES (12,'Coconut Bar',120,'taste good','images/bingan/hunshu.jpg',4,1);
INSERT INTO `cake` VALUES (13,'Black Forest Cake',20,'new...','images/new/new1.jpg',5,1);
INSERT INTO `cake` VALUES (14,'Pudding Cake',34,'new...','images/new/new2.jpg',5,1);
INSERT INTO `cake` VALUES (15,'Fruit Cake',50,'new...','images/new/new3.jpg',5,1);
INSERT INTO `cake` VALUES (16,'Lovely Animal Style Cake',32,'new...','images/new/new4.jpg',5,1);
/*!40000 ALTER TABLE `cake` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table category
#

CREATE TABLE `category` (
  `id` bigint(20) NOT NULL auto_increment,
  `name` varchar(30) default NULL,
  `remark` varchar(2000) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=gbk;
INSERT INTO `category` VALUES (1,'cake',NULL);
INSERT INTO `category` VALUES (2,'bread',NULL);
INSERT INTO `category` VALUES (3,'cookies',NULL);
INSERT INTO `category` VALUES (4,'sweet',NULL);
INSERT INTO `category` VALUES (5,'new products',NULL);
/*!40000 ALTER TABLE `category` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table comment
#

CREATE TABLE `comment` (
  `Id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) NOT NULL default '0',
  `orderid` bigint(20) NOT NULL default '0',
  `type` int(1) NOT NULL default '0',
  `content` varchar(2000) default NULL,
  `occurTime` varchar(20) default NULL,
  PRIMARY KEY  (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40000 ALTER TABLE `comment` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table diy
#

CREATE TABLE `diy` (
  `id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) default NULL,
  `phone` varchar(11) default NULL,
  `amount` decimal(10,2) default NULL,
  `code` varchar(22) default NULL,
  `status` int(11) default NULL,
  `address` varchar(200) default NULL,
  `quantity` int(11) default NULL,
  `remark` varchar(500) default NULL,
  `description` varchar(1000) default NULL,
  `picture` varchar(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=gbk;
/*!40000 ALTER TABLE `diy` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table manager
#

CREATE TABLE `manager` (
  `id` bigint(20) NOT NULL auto_increment,
  `username` varchar(30) default NULL,
  `password` varchar(20) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=gbk;
INSERT INTO `manager` VALUES (1,'admin','123456');
/*!40000 ALTER TABLE `manager` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table message
#

CREATE TABLE `message` (
  `Id` bigint(20) NOT NULL auto_increment,
  `userid` bigint(20) NOT NULL default '0',
  `content` varchar(2000) default NULL,
  `occurTime` varchar(20) default NULL,
  PRIMARY KEY  (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
INSERT INTO `message` VALUES (1,1,'something other','2012-05-07 20:02:00');
INSERT INTO `message` VALUES (2,1,'Hey,What are you doing right','2012-05-07 20:38:57');
/*!40000 ALTER TABLE `message` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table myorder
#

CREATE TABLE `myorder` (
  `id` bigint(20) NOT NULL auto_increment,
  `code` varchar(22) default NULL,
  `amount` decimal(10,2) default NULL,
  `status` int(11) default NULL,
  `userid` bigint(20) default NULL,
  `address` varchar(200) default NULL,
  `phone` varchar(11) default NULL,
  `remark` varchar(500) default NULL,
  PRIMARY KEY  (`id`),
  KEY `FK_Reference_2` (`userid`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=gbk;
/*!40000 ALTER TABLE `myorder` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table orderdetail
#

CREATE TABLE `orderdetail` (
  `id` bigint(20) NOT NULL auto_increment,
  `orderid` bigint(20) default NULL,
  `cakeid` bigint(20) default NULL,
  `quantity` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=gbk;
/*!40000 ALTER TABLE `orderdetail` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table shoppingcart
#

CREATE TABLE `shoppingcart` (
  `id` bigint(20) NOT NULL auto_increment,
  `cakeid` bigint(20) default NULL,
  `quantity` int(11) default NULL,
  `userid` bigint(20) default NULL,
  `remark` varchar(500) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=gbk;
/*!40000 ALTER TABLE `shoppingcart` ENABLE KEYS */;
UNLOCK TABLES;

#
# Table structure for table user
#

CREATE TABLE `user` (
  `id` bigint(20) NOT NULL auto_increment,
  `username` varchar(30) default NULL,
  `password` varchar(20) default NULL,
  `idcard` varchar(18) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=gbk;
INSERT INTO `user` VALUES (1,'customer','123456','360835198805242115');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;

#
#  Foreign keys for table cake
#

ALTER TABLE `cake`
ADD CONSTRAINT `FK_Reference_1` FOREIGN KEY (`category`) REFERENCES `category` (`id`);

#
#  Foreign keys for table myorder
#

ALTER TABLE `myorder`
ADD CONSTRAINT `FK_Reference_2` FOREIGN KEY (`userid`) REFERENCES `user` (`id`);


/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
